<form id="form1" name="form1" method="post" action="product_brand.manage.php" style="margin-bottom:20px; ">
<input type="hidden" name="action" id="action" value="update" />
<input name="id" type="hidden" id="id" value="<tpl> $brand_array.pb_id </tpl>" />
  <table class="from_table">
    <tr>
      <th width="123" class="th2"><tpl> $langSysProductBrandName </tpl>：</th>
      <td width="530" align="left" class="td1"><input name="txtBrandName" maxlength="33" type="text" class="txtinput" id="txtBrandName" value="<tpl> $brand_array.pb_name </tpl>" />      
		<label style="display:none" for="txtBrandName" class="wrong" metaDone="true" generated="true"></label>		</td>
    </tr>
    <tr>
      <th class="th2"><tpl> $langSysProductBrandParent </tpl>：</th>
      <td width="530" align="left" class="td1">
	  	<select name="txtParentBrand" id="txtParentBrand">
			<option value="0" <tpl> if '0' eq $brand_array.pb_u_id </tpl>selected="selected"<tpl> /if </tpl>><tpl> $langSysProductBrandDefault </tpl></option>
			<tpl> section name=loop loop=$sel_brand </tpl>
			<option <tpl> if $sel_brand[loop][0] eq $brand_array.pb_u_id </tpl>selected="selected"<tpl> /if </tpl> value="<tpl> $sel_brand[loop][0] </tpl>"><tpl> $sel_brand[loop][2] </tpl></option>
			<tpl> /section </tpl>
		</select>
	  </td>
    </tr>
	<tr>
      <th class="th2"><tpl> $langSysProductBrandSort </tpl>：</th>
      <td width="530" align="left" class="td1"><input name="txtBrandSort" type="text" class="txtinput" id="txtBrandSort" value="<tpl> $brand_array.pb_sort  </tpl>" size="10" />
		  <label style="display:none" for="txtBrandSort" class="wrong" metaDone="true" generated="true"></label>		  </td>
    </tr>
    <tr>
      <td>
</td>
      <td width="530" align="left"> <span class="btn_left">
	  <input type="submit" class="btn_submit" name="Submit" value="<tpl> $langSysCSave </tpl>" />　	  </span>
	  <span class="btn_left">
		<input id="butt_list" class="btn_submit" type="button" value="<tpl> $langSysProductBrandReturn </tpl>" />
		</span>	</td>

    </tr>
  </table>
</form>
<script>
$(document).ready(function() {
	hideMessage();		
	
	//返回列表
	$("#butt_list").click(function(){
		ShowDiv = "result_content";
		getPageContent("product_brand.manage.php?action=ajax_list");
	});	
//编辑
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		success:       function(msg){
							hideLoading();
							showMessage(msg.message,msg.type);
							if(msg.type == '1'){
								ShowDiv	= 'result_content';
								getPageContent("product_brand.manage.php?action=ajax_list");
							}
						},
		type:      'post',
		dataType:  'json'
	};
	
	//对添加表单做的验证定义
	$("#form1").validate({
		errorClass: "wrong",
		rules: {
			txtBrandName: {required:true},
			txtBrandSort: {required:true,number:true}
			
		},
		messages: {
			txtBrandName: {required: "<tpl> $errSysProductBrandNameIsEmpty </tpl>"},
			txtBrandSort: {required:"<tpl> $errSysProductBrandSortIsEmpty </tpl>",number:"<tpl> $errSysProductBrandSortIsNotNumber </tpl>"}
		},
		submitHandler: function() {
			$('#form1').ajaxSubmit(options);
		}
	});
});
</script>